package sheji.Sinle3;

/**
 * @author lj
 * @Description: 双重校验锁
 * @date 2020-10-29 21:43
 * @QQ 851477108
 */


public class SingleDCL {
    private volatile static SingleDCL singleDCL;
    private SingleDCL(){}

    public static SingleDCL getInstance(){
        if (singleDCL == null){
            synchronized(SingleDCL.class){
                if (singleDCL == null){
                    singleDCL = new SingleDCL();
                }
            }
        }
        return singleDCL;
    }

    public static void showMessage(){
        System.out.println("双重校验锁");
    }
}
